package com.ffcs.ffxtc.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Web配置类
 *
 * @author zhangzhengxing
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
  /**
   * 添加Web项目的拦截器
   */
  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    // 对所有访问路径，都通过WebMvcConfigurer类型的拦截器进行拦截
    registry.addInterceptor(new GlobalHandlerInterceptor()).addPathPatterns("/**")
            .excludePathPatterns("/drawdbUser/drawdbUserAdd", "/index.html", "/drawdbUser/login", "/css/**", "/images/**",
                    "/js/**", "/fonts/**","/webjars/**","/doc.html","/favicon.ico","/v3/api-docs/**","/minio/**");
    //放行登录页，登陆操作，静态资源
  }
}
